\(\int (a+\frac {b}{x})^2 x \, dx\) [1563]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 22 \[ \int \left (a+\frac {b}{x}\right )^2 x \, dx=2 a b x+\frac {a^2 x^2}{2}+b^2 \log (x) \]

[Out]

2*a*b*x+1/2*a^2*x^2+b^2*ln(x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {269, 45} \[ \int \left (a+\frac {b}{x}\right )^2 x \, dx=\frac {a^2 x^2}{2}+2 a b x+b^2 \log (x) \]

[In]

Int[(a + b/x)^2*x,x]

[Out]

2*a*b*x + (a^2*x^2)/2 + b^2*Log[x]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 269

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[x^(m + n*p)*(b + a/x^n)^p, x] /; FreeQ[{a, b, m
, n}, x] && IntegerQ[p] && NegQ[n]

Rubi steps \begin{align*} \text {integral}& = \int \frac {(b+a x)^2}{x} \, dx \\ & = \int \left (2 a b+\frac {b^2}{x}+a^2 x\right ) \, dx \\ & = 2 a b x+\frac {a^2 x^2}{2}+b^2 \log (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00 \[ \int \left (a+\frac {b}{x}\right )^2 x \, dx=2 a b x+\frac {a^2 x^2}{2}+b^2 \log (x) \]

[In]

Integrate[(a + b/x)^2*x,x]

[Out]

2*a*b*x + (a^2*x^2)/2 + b^2*Log[x]

Maple [A] (verified)

Time = 0.02 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.95

method result size
default \(2 a b x +\frac {a^{2} x^{2}}{2}+b^{2} \ln \left (x \right )\) \(21\)
risch \(2 a b x +\frac {a^{2} x^{2}}{2}+b^{2} \ln \left (x \right )\) \(21\)
parallelrisch \(2 a b x +\frac {a^{2} x^{2}}{2}+b^{2} \ln \left (x \right )\) \(21\)
norman \(\frac {\frac {1}{2} a^{2} x^{3}+2 a b \,x^{2}}{x}+b^{2} \ln \left (x \right )\) \(28\)

[In]

int((a+b/x)^2*x,x,method=_RETURNVERBOSE)

[Out]

2*a*b*x+1/2*a^2*x^2+b^2*ln(x)

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91 \[ \int \left (a+\frac {b}{x}\right )^2 x \, dx=\frac {1}{2} \, a^{2} x^{2} + 2 \, a b x + b^{2} \log \left (x\right ) \]

[In]

integrate((a+b/x)^2*x,x, algorithm="fricas")

[Out]

1/2*a^2*x^2 + 2*a*b*x + b^2*log(x)

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91 \[ \int \left (a+\frac {b}{x}\right )^2 x \, dx=\frac {a^{2} x^{2}}{2} + 2 a b x + b^{2} \log {\left (x \right )} \]

[In]

integrate((a+b/x)**2*x,x)

[Out]

a**2*x**2/2 + 2*a*b*x + b**2*log(x)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91 \[ \int \left (a+\frac {b}{x}\right )^2 x \, dx=\frac {1}{2} \, a^{2} x^{2} + 2 \, a b x + b^{2} \log \left (x\right ) \]

[In]

integrate((a+b/x)^2*x,x, algorithm="maxima")

[Out]

1/2*a^2*x^2 + 2*a*b*x + b^2*log(x)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.95 \[ \int \left (a+\frac {b}{x}\right )^2 x \, dx=\frac {1}{2} \, a^{2} x^{2} + 2 \, a b x + b^{2} \log \left ({\left | x \right |}\right ) \]

[In]

integrate((a+b/x)^2*x,x, algorithm="giac")

[Out]

1/2*a^2*x^2 + 2*a*b*x + b^2*log(abs(x))

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91 \[ \int \left (a+\frac {b}{x}\right )^2 x \, dx=b^2\,\ln \left (x\right )+\frac {a^2\,x^2}{2}+2\,a\,b\,x \]

[In]

int(x*(a + b/x)^2,x)

[Out]

b^2*log(x) + (a^2*x^2)/2 + 2*a*b*x